package com.dt76.smallloanbackendservice.controller.xiaohao;

import com.dt76.smallloanbackendservice.pojo.xiaohao.Contract;
import com.dt76.smallloanbackendservice.service.huxuan.SenderService;
import com.dt76.smallloanbackendservice.service.xiaohao.ContractService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;


@Controller
@RequestMapping("/xiaohao")
public class ContractController {

    @Resource
    private ContractService contractService;
    @Resource
    private SenderService senderService;

    @PostMapping("/Contract/addContract")
    @ResponseBody
    public int addContract(@RequestBody Contract contract) {
        senderService.sendEmail(1,"409193765@qq.com");
        return contractService.addContract(contract);
    }
}
